# Contributor: G.J.R. Timmer <gjr.timmer@gmail.com>
# Maintainer: G.J.R. Timmer <gjr.timmer@gmail.com>
pkgname=postgresql-pg_cron
pkgver=1.6.4
pkgrel=0
pkgdesc="Cron-based scheduler for PostgreSQL 9.5+"
url="https://github.com/citusdata/pg_cron"
arch="all"
license="PostgreSQL"
makedepends="postgresql-dev"
provides="pg_cron=$pkgver-r$pkgrel"
install="$pkgname.post-install"
source="https://github.com/citusdata/pg_cron/archive/v$pkgver/pg_cron-$pkgver.tar.gz"
builddir="$srcdir/pg_cron-$pkgver"
options="!check"  # no tests provided

prepare() {
	default_prepare
	# Remove -Werror from Makefile
	# Required to compile on alpine, to ignore compilation warnings
	sed "s/-Werror //" -i Makefile
}

build() {
	make
}

package() {
	depends="postgresql$(pg_config --major-version)"

	make DESTDIR="$pkgdir" install
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
c61ffce39c4db5f7d7733d3fca7f63d80d6aec991bda8f59f3423571267d3eacbd5d13a625cecdc15d44b7dc12979a65dc9d8c46b11a23628424081705cac393  pg_cron-1.6.4.tar.gz
"
